from math import sqrt
import unittest

class Bascara:
	def __init__ (self, a, b, c):
		self.a = a
		self.b = b
		self.c = c
		self.total = []

	def resolvente (self):
		root = (self.b*self.b)-(4*self.a*self.c)
		if root < 0:
			return [] 
		try:
			self.total.append((-(self.b)+sqrt(root))/(2*self.a))
			self.total.append((-(self.b)-sqrt(root))/(2*self.a))
		except ZeroDivisionError:
			return "error, no se puede dividir por cero"
	
		self.total.sort()
		return self.total

class testBascara (unittest.TestCase):
			
	def test(self):
		self.b = Bascara(1, -1, -30)
		self.assertEqual (self.b.resolvente (), [-5.0, 6.0])		

if __name__ == "__main__":
	unittest.main ()  



#b = Bascara (1, -1, -30)
#print b.resolvente()
